package org.example.ui;

import org.example.business.SearchBusiness;

import javax.swing.*;
import java.awt.*;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;

public class PromptComboBox extends JComboBox<String> {
    private DefaultComboBoxModel<String> model;
    private int type;
    public PromptComboBox(int type) {
        model = new DefaultComboBoxModel<>();
        this.type = type;
        setFont(new Font("", Font.BOLD, 20));
        setModel(model);
    }
    public void update(String search) {
        model.removeAllElements();
        model.addAll(SearchBusiness.setSearch(search, type));
    }
}
